Ext.define('AmpleHarvest.views.article.cArticle',
{
//	jsonPost		: eval("'" + g_arr_Requests["hl"] + "'"),
	extend			: 'Ext.panel.Panel',
//	alias			: 'widget.ArticleWindow',
	alias			: 'widget.ampleharvest-views-article-carticle',
	requires		:
	[
	 		"AmpleHarvest.views.article.eventHandler.cWindowEvents",
//			"AmpleHarvest.views.article.cAreaCenter",
//			"AmpleHarvest.views.article.cAreaEast",
//			"AmpleHarvest.views.article.cAreaWest",
//			"AmpleHarvest.eventHandler.cWindowEvents",
//			'AmpleHarvest.layout.cLayout',

			'Ext.LoadMask'
	],
	bubbleEvents	:
	[
		'doclassificationchange'
	],
	anchor			: '100% 100%',
	m_str_id		: '',
	layout			: 'border',
	listeners		:
	{
		highlight : function(hl_object, str_Class, str_Attrib)
		{
			console.log('HL');
			this.m_obj_ArticleWin.push_highlight(hl_object, str_Class,
					str_Attrib
			);
		}
	},
	
	initComponent	: function()
	{
		var obj_This = this;

		Ext.Ajax.request(
		{
			url		: obj_config.C_STR_EXTERNAL_PATH+'/rest/statistics/hitCount.php',

			params	:
			{
				article	: this.m_str_id
			}
		}
		);

		
		this.m_obj_ArticleWin = Ext.create(
				"AmpleHarvest.views.article.cAreaCenter",
				{
					m_str_id	: this.m_str_id,
					region	: "center"
				}
		);
		this.m_obj_EnhancementWin = Ext.create(
				"AmpleHarvest.views.article.cAreaEast",
				{
					m_str_id	: this.m_str_id,
					region		: "east",
					ahCaller	: this
				}
		);
		this.m_obj_NavigationWin = Ext.create(
				"AmpleHarvest.views.article.cAreaWest",
				{
					m_str_id	: this.m_str_id,
					region		: "west",
					ahCaller	: this
				}
		);

//		this.addEvents('highlight');
//
//		this.on('highlight', function(hl_object, str_Class, str_Attrib)
//				{
//			console.log('HL');
//					this.m_obj_ArticleWin.push_highlight(hl_object, str_Class,
//							str_Attrib
//					);
//				});

		this.items =
		[
				this.m_obj_ArticleWin//,
//				this.m_obj_NavigationWin//,
//				this.m_obj_EnhancementWin
		]
		this.callParent();

		this.m_obj_SystemEvents = Ext.create(
				"AmpleHarvest.eventHandler.cWindowEvents",
				{
					m_obj_MsgBus	: obj_This,
					m_obj_Desktop	: obj_This
				}
		);
	},

	collapseAll		: function()
	{
		this.m_obj_NavigationWin.collapse(false, false);
		this.m_obj_EnhancementWin.collapse(false, false);
		this.m_obj_ArticleWin.collapse();
	},

	expandAll		: function()
	{
		this.m_obj_NavigationWin.expand(false, false);
		this.m_obj_EnhancementWin.expand(false, false);
		this.m_obj_ArticleWin.expand();
	}
});


